#include "../include/twentySeven_27.h"

JumpCount::JumpCount()
{


}

JumpCount::JumpCount(int count)
:m_nSteps(count)
{


}

JumpCount::~JumpCount()
{

}

JumpCount& JumpCount::operator=(JumpCount &ff)
{
    if (this == &ff)
        return *this;

    m_nSteps = ff.m_nSteps;
    return *this;
}


JumpCount::JumpCount(JumpCount &ff)
{
    m_nSteps = ff.m_nSteps;
}

int JumpCount::count()
{
     return  jump(m_nSteps);

}

int JumpCount::jump(int n)
{
    if (n <= 0) return 0;
    if (n == 1 || n == 2) return n;
    return jump(n - 1) + jump(n - 2);
}


void TestFor27()
{

    int num ;
    cout << "Please input your steps :" << endl;
    cin >> num;
    JumpCount jump(num);
    num = jump.count();

    cout << "There are " << num << "  steps ." << endl;
}
